﻿// ===============================================================================
// ParamNotNullOrEmptyTest.cs
// EOS Framework
// ===============================================================================
// Copyright (c) EOS Development Group. All rights reserved.
// ===============================================================================

namespace EOS.Framework.Tools.Tests
{
    using System;
    using EOS.Framework.Tools.Aspects;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// This is a test class for ParamNotNullOrEmptyTest and is intended
    /// to contain all ParamNotNullOrEmptyTest Unit Tests
    /// </summary>
    [TestClass()]
    public class ParamNotNullOrEmptyTest
    {
        private TestContext testContextInstance;

        /// <summary>
        /// Gets or sets the test context which provides
        /// information about and functionality for the current test run.
        /// </summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        /// <summary>
        /// Validating test.
        /// </summary>
        [TestMethod()]
        public void ValidationTest1()
        {
            Mockups.AspectsMockup mockup = new Mockups.AspectsMockup();
            mockup.NotNullOrEmptyParamMethod1("ABC");
        }

        /// <summary>
        /// Validating test.
        /// </summary>
        [TestMethod()]
        public void ValidationTest()
        {
            Mockups.AspectsMockup mockup = new Mockups.AspectsMockup();
            mockup.NotNullOrEmptyParamMethod2(123);
        }

        /// <summary>
        /// Validating test. Empty value not accepted.
        /// </summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void EmptyValueValidationTest()
        {
            Mockups.AspectsMockup mockup = new Mockups.AspectsMockup();
            mockup.NotNullOrEmptyParamMethod1(" ");
        }

        /// <summary>
        /// Validating test. Value with blanks only not accepted.
        /// </summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void BlanksOnlyValueValidationTest()
        {
            Mockups.AspectsMockup mockup = new Mockups.AspectsMockup();
            mockup.NotNullOrEmptyParamMethod1(string.Empty);
        }

        /// <summary>
        /// Validating test. Value cannot be null.
        /// </summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentNullException))]
        public void NullValueValidationTest()
        {
            Mockups.AspectsMockup mockup = new Mockups.AspectsMockup();
            mockup.NotNullOrEmptyParamMethod1(null);
        }

        /// <summary>
        /// Constructor test. Parameter name cannot be empty.
        /// </summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void ParamNotNullOrEmptyConstructorEmptyParamNameTest()
        {
            new ParamNotNullOrEmpty(string.Empty);
        }

        /// <summary>
        /// Constructor test. Parameter name cannot have only blanks.
        /// </summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void ParamNotNullOrEmptyConstructorBlanksOnlyParamNameTest()
        {
            new ParamNotEmpty(" ");
        }

        /// <summary>
        /// Constructor test. Parameter name cannot be null.
        /// </summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ParamNotNullOrEmptyConstructorNullParamNameTest()
        {
            new ParamNotNullOrEmpty(null);
        }
    }
}
